package com.detech.sbom.base.satoken.enumtype;


import cn.hutool.core.util.StrUtil;

/**
 * 设备类型
 * 针对一套 用户体系
 *
 */
public enum DeviceType {

    /**
     * pc端
     */
    PC("pc"),

    /**
     * app端
     */
    APP("app"),

    /**
     * 小程序端
     */
    XCX("xcx");

    private final String device;

    public String getDevice() {
        return device;
    }

    private DeviceType(String device){
        this.device = device;
    }

    public static DeviceType getDeviceType(String str) {
        for (DeviceType value : values()) {
            if (StrUtil.contains(str, value.getDevice())) {
                return value;
            }
        }
        throw new RuntimeException("'DeviceType' not found By " + str);
    }
}
